<?php
session_start();
include_once("connexion.php");
include('menu.php');


//Récupération des données du formulaire
if( isset($_POST["inscription"])){
	$user_prenom = $_POST["prenom"];
	$user_nom = $_POST["nom"];
	$user_mail = $_POST["mail"];
	$user_pwd = $_POST["password"];
	$verifpassword = $_POST["verifpassword"];
	$user_tel1 = $_POST["num1"];
	$user_tel2 = $_POST["num2"];
	
//Test de validité du mot de passe
	if($verifpassword == $user_pwd ){

		//Enregistrement en BDD
		$query = "INSERT INTO user VALUES('','$user_nom','$user_prenom','$user_mail','$user_pwd','$user_tel1','$user_tel2',4)";
		$res = mysqli_query($connexion, $query);
		header("location:inscription_ok.php");
	}
	else{

	echo "Les mots de passe ne correspondent pas !";
	}
}


include ("sign_up.php");



?>
